package com.huifaapp.mall.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.huifaapp.mall.R;

import java.util.List;

/**
 * Created by 段昱 on 2017/12/15.
 */

public class Itme_evaluaterecyclerview_imgeAdapter extends RecyclerView.Adapter<Itme_evaluaterecyclerview_imgeAdapter.Itme_MyViewHolder> {
    private Context context;
    private List<String> list;
    private View view;

    public Itme_evaluaterecyclerview_imgeAdapter(Context context, List<String> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public Itme_evaluaterecyclerview_imgeAdapter.Itme_MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        view = View.inflate(context, R.layout.itme_evaluaterecyclerview_imge, null);
        Itme_MyViewHolder itme_myViewHolder = new Itme_MyViewHolder(view);
        return itme_myViewHolder;
    }

    @Override
    public void onBindViewHolder(Itme_evaluaterecyclerview_imgeAdapter.Itme_MyViewHolder holder, int position) {
        if (mitem_evaluater_imgeonBindViewHolder != null) {
            mitem_evaluater_imgeonBindViewHolder.itmeevaluater_imge(holder.imageView, (Integer) holder.imageView.getTag(),context);
        }

        holder.itemView.setTag(position);
    }

    public interface item_evaluater_imgeonBindViewHolder {
        void itmeevaluater_imge(ImageView imageView, int position,Context context);
    }

    public item_evaluater_imgeonBindViewHolder mitem_evaluater_imgeonBindViewHolder;

    public void setitmeevaluater_imge(item_evaluater_imgeonBindViewHolder mitem_evaluater_imgeonBindViewHolder){
        this.mitem_evaluater_imgeonBindViewHolder=mitem_evaluater_imgeonBindViewHolder;
    }


    public int getItemCount() {
        return list.size();
    }

    class Itme_MyViewHolder extends RecyclerView.ViewHolder {

        private final ImageView imageView;

        public Itme_MyViewHolder(View itemView) {
            super(itemView);
            imageView = (ImageView) itemView.findViewById(R.id.itme_evaimge);
        }
    }
}
